package com.example.hellodemo.pageView2;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.hellodemo.R;

public class ViewPage2Activity extends AppCompatActivity {
    private Button recycle_adapter_btn,page_fragment ;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_view_page2);


        recycle_adapter_btn = findViewById(R.id.page_Recycle);
        recycle_adapter_btn.setOnClickListener(listener);

        page_fragment = findViewById(R.id.page_fragment);
        page_fragment.setOnClickListener(listener);

    }


    private View.OnClickListener listener = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Intent intent = null;

            if (v.getId() == R.id.page_Recycle){
                intent = new Intent(getApplicationContext(),ViewPage_RecycleAdapter.class);
            }else if (v.getId() == R.id.page_fragment){
                intent = new Intent(getApplicationContext(),FragmentAdapterActivity.class);
            }

            if (intent != null){
                startActivity(intent);
            }
        }

    };
}
